FROM python:3.11-slim

ARG PIP_MIRROR='https://mirrors.aliyun.com/pypi/simple/'

ENV DISPLAY :99
ENV CHROME_VERSION 111.0.5563.64

#COPY msyh.ttc /usr/share/fonts/

ADD https://registry.npmmirror.com/-/binary/chromedriver/${CHROME_VERSION}/chromedriver_linux64.zip /usr/bin/

RUN apt-get update && \
    apt-get -y install wget gnupg xvfb gtk2-engines-pixbuf unzip libnss3 && \
    apt-get -y install xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable && \
    apt-get -y install imagemagick x11-apps && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*


RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - && \
    sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
    apt-get update && \
    apt-get install google-chrome-stable -y && \
    google-chrome --no-sandbox --version && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*
